package com.yuexun.beilunpatient.ui.doctor.ui;

import android.os.Bundle;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;

import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.base.BaseKJActivity;
import com.yuexun.beilunpatient.ui.doctor.ui.fragment.Frag_Doc_Collect;
import com.yuexun.beilunpatient.ui.doctor.ui.fragment.Frag_Doc_See;
import com.yuexun.beilunpatient.ui.doctor.ui.fragment.Frag_Doc_Sign;

import org.kymjs.kjframe.ui.KJFragment;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by chenss on 2018/3/22 0022.
 */

public class Act_Doc_Main extends BaseKJActivity {
    @Bind(R.id.see)
    TextView see;
    @Bind(R.id.see_img)
    ImageView seeImg;
    @Bind(R.id.sign)
    TextView sign;
    @Bind(R.id.sign_img)
    ImageView signImg;
    @Bind(R.id.collect)
    TextView collect;
    @Bind(R.id.collect_img)
    ImageView collectImg;
    @Bind(R.id.doc_content)
    FrameLayout docContent;

    KJFragment docCollect;
    KJFragment docSee;
    KJFragment docSign;

    @Override
    public void setRootView() {
        setContentView(R.layout.act_doc_main);
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {
        docCollect = new Frag_Doc_Collect();
        docSee = new Frag_Doc_See();
        docSign = new Frag_Doc_Sign();
        changeFragment(R.id.doc_content, docSee);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick({R.id.title_back, R.id.see_ll, R.id.sign_ll, R.id.collect_ll})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.title_back:
                finish();
                break;
            case R.id.see_ll:
                see.setTextColor(getResources().getColor(R.color.main_text_02));
                seeImg.setBackgroundColor(getResources().getColor(R.color.main_text_02));
                sign.setTextColor(getResources().getColor(R.color.txt_black1));
                signImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                collect.setTextColor(getResources().getColor(R.color.txt_black1));
                collectImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                changeFragment(R.id.doc_content, docSee);
                break;
            case R.id.sign_ll:
                see.setTextColor(getResources().getColor(R.color.txt_black1));
                seeImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                sign.setTextColor(getResources().getColor(R.color.main_text_02));
                signImg.setBackgroundColor(getResources().getColor(R.color.main_text_02));
                collect.setTextColor(getResources().getColor(R.color.txt_black1));
                collectImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                changeFragment(R.id.doc_content, docSign);
                break;
            case R.id.collect_ll:
                see.setTextColor(getResources().getColor(R.color.txt_black1));
                seeImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                sign.setTextColor(getResources().getColor(R.color.txt_black1));
                signImg.setBackgroundColor(getResources().getColor(R.color.transparent));
                collect.setTextColor(getResources().getColor(R.color.main_text_02));
                collectImg.setBackgroundColor(getResources().getColor(R.color.main_text_02));
                changeFragment(R.id.doc_content, docCollect);
                break;
        }
    }
}
